ALTER VIEW [dbo].[View_FW_Action2User]
AS
SELECT   NEWID() AS  Action2UserGUID, 
		 fa.ActionGUID,
         fa.ActionCode,
		 ff.FunctionCode,
		 ff.FunctionGUID,
		 ff.ParentGUID,
		 ff.ModuleGUID,
		 fu.UserGUID
FROM  dbo.FW_User fu 
LEFT JOIN   dbo.FW_StandardRole2USer fs ON fu.UserGUID=fs.UserGUID
LEFT JOIN dbo.FW_StandardRole  fsr ON fs.StandardRoleGUID=fsr.StandardRoleGUID
LEFT JOIN dbo.FW_StandardRole2Action fsa ON fsa.StandardRoleGUID=fsr.StandardRoleGUID
LEFT JOIN dbo.FW_Action fa ON fa.ActionGUID=fsa.ActionGUID
LEFT JOIN dbo.FW_Function ff ON ff.FunctionGUID=fa.FunctionGUID